<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>菜单列表</title>
    <script type="text/javascript" src="/public.js"></script>
    <script type="text/javascript" src="/js/menu/init.js"></script>
</head>
<body>
<div>
    <div id="tb" style="padding:3px">
    </div>

    <!-- 工具条 -->
    <div id="toolbarId" style="padding: 5px; height: auto">
        <!-- todo: id="buttonId" is must-->
        <div style="margin-bottom: 5px" id="buttonId">
            <a href="javascript:void(0)" id="reloadId"
               class="easyui-linkbutton" onclick="reload()" isButton="hasRole('admin')"
               iconCls="icon-reload" plain="true">刷新</a>
            <a href="javascript:void(0)" id="addRootId" isButton="hasRole('admin')"
               class="easyui-linkbutton" onclick="openDialog(0)"
               iconCls="icon-add" plain="true">根菜单添加</a>
            <a href="javascript:void(0)" id="addSubId" isButton="hasRole('admin')"
               class="easyui-linkbutton" onclick="openDialog(1)"
               iconCls="icon-add" plain="true">子菜单添加</a>
            <a href="javascript:void(0)" id="updateId" isButton="hasRole('admin')"
               class="easyui-linkbutton" onclick="updateDialog()"
               iconCls="icon-edit" plain="true">修改</a>
            <a href="javascript:void(0)" id="delId"
               class="easyui-linkbutton" onclick="del()" isButton="hasPerm('sys:menu:delete')"
               iconCls="icon-remove" plain="true">删除</a>
        </div>
    </div>
    <div>
        <ul id="menuTreeId" class="" style="margin: 10px 0px 0px 20px;"></ul>
    </div>

    <!-- add对话框-->
    <div id="dialogId" class="easyui-dialog" title=""
         style="width: 450px; height: 320px;" data-options="modal:true"
         closed="true" buttons="#dialogIdToolbarId">
        <!--<form id="fromId" method="post" style="margin-top: 30px" enctype="multipart/form-data">-->
        <form id="fromId" method="post" style="margin-top: 30px">
            <table width="100%" height=""
                   style="BORDER-COLLAPSE: collapse;" cellpadding="1" border="1"
                   borderColor="#BEBEBE" align="center">
                <tr>
                    <td style="background: #E0EEEE"><label>菜单名称：</label></td>
                    <td>
                        <input id="pkId" type="hidden" name="id" />
                        <input type="text" class="easyui-validatebox" id="menuName"
                               name="menuName" missingMessage="请输入菜单名称"
                               data-options="required:true,validType:['minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>URL地址：</label></td>
                    <td><input type="text" class="easyui-validatebox" id="menuUrl"
                               name="menuUrl" missingMessage="请输入URL地址"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>权限标识：</label></td>
                    <td><input type="text" class="easyui-validatebox" id="permission"
                               name="permission" missingMessage="请输入权限标识"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>是否按钮：</label></td>
                    <td>
                        <select id="isButton" class="easyui-combobox" name="isButton"
                                style="width: 50px;" editable="false"
                                data-options="panelHeight:'auto'">
                            <option value="1">否</option>
                            <option value="0">是</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>排序：</label></td>
                    <td><input type="text" class="easyui-validatebox" id="sort"
                               name="sort" missingMessage="请输入排序"
                               data-options="required:true,validType:['Integer','unNormal','minLength[1]','maxLength[2]']" value="1" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>图标：</label></td>
                    <td><input type="text" class="easyui-validatebox" id="icons"
                               name="icons" missingMessage="请输入图标"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[12]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>描述：</label></td>
                    <td><input type="text" class="easyui-validatebox" id="menuDes"
                               name="menuDes" missingMessage="请描述"
                               data-options="required:false,validType:['unNormal','minLength[1]','maxLength[35]']" />
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div id="dialogIdToolbarId">
        <div style="margin-bottom: 5px">
            <a href="javascript:void(0)" id="saveId" class="easyui-linkbutton" iconCls="icon-ok" plain="true">保存</a>
            <a href="javascript:void(0)" id="closeId" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">取消</a>
        </div>
    </div>

    <!-- update对话框-->
    <div id="dialogId2" class="easyui-dialog" title=""
         style="width: 450px; height: 320px;" data-options="modal:true"
         closed="true" buttons="#dialogIdToolbarId2">
        <!--<form id="fromId" method="post" style="margin-top: 30px" enctype="multipart/form-data">-->
        <form id="fromId2" method="post" style="margin-top: 30px">
            <table width="100%" height=""
                   style="BORDER-COLLAPSE: collapse;" cellpadding="1" border="1"
                   borderColor="#BEBEBE" align="center">
                <tr>
                    <td style="background: #E0EEEE"><label>菜单名称：</label></td>
                    <td>
                        <input id="pkId2" type="hidden" name="id" />
                        <input type="text" class="easyui-validatebox"
                               name="menuName" missingMessage="请输入菜单名称"
                               data-options="required:true,validType:['minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>URL地址：</label></td>
                    <td><input type="text" class="easyui-validatebox"
                               name="menuUrl" missingMessage="请输入URL地址"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>权限标识：</label></td>
                    <td><input type="text" class="easyui-validatebox"
                               name="permission" missingMessage="请输入权限标识"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[20]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>是否按钮：</label></td>
                    <td>
                        <select id="isButton2" class="easyui-combobox" name="isButton"
                                style="width: 50px;" editable="false"
                                data-options="panelHeight:'auto'">
                            <option value="1">否</option>
                            <option value="0">是</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>排序：</label></td>
                    <td><input type="text" class="easyui-validatebox"
                               name="sort" missingMessage="请输入排序"
                               data-options="required:true,validType:['Integer','unNormal','minLength[1]','maxLength[2]']" value="1" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>图标：</label></td>
                    <td><input type="text" class="easyui-validatebox"
                               name="icons" missingMessage="请输入图标"
                               data-options="required:false,validType:['unChinese','unNormal','minLength[1]','maxLength[12]']" />
                    </td>
                </tr>
                <tr>
                    <td style="background: #E0EEEE"><label>描述：</label></td>
                    <td><input type="text" class="easyui-validatebox"
                               name="menuDes" missingMessage="请描述"
                               data-options="required:false,validType:['unNormal','minLength[1]','maxLength[35]']" />
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div id="dialogIdToolbarId2">
        <div style="margin-bottom: 5px">
            <a href="javascript:void(0)" id="saveId2" class="easyui-linkbutton" iconCls="icon-ok" plain="true">保存</a>
            <a href="javascript:void(0)" id="closeId2" class="easyui-linkbutton" iconCls="icon-cancel" plain="true">取消</a>
        </div>
    </div>
</div>
</body>
</html>